package com.pk.flink.functions.source;

import org.apache.flink.api.common.functions.Partitioner;

public class AccessPartitionFunction implements Partitioner<String> {

    @Override
    public int partition(String s, int i) {
        if(s.equalsIgnoreCase("beijing")) {
            return 0;
        }
        else if(s.equalsIgnoreCase("tianjin")) {
            return 1;
        }
        else{
            return 2;
        }
    }
}
